<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
	xmlns:c="http://xmlns.jcp.org/jsf/composite"
	xmlns:p="http://primefaces.org/ui">

<ui:decorate template="/jsp/WEB/pageLayout.xhtml">
	<ui:define name="centro">
		<h:form id="form">
			<p:panel header="Listagem de Veículos Estacionados">

				<f:facet name="actions">
					<h:commandLink
						styleClass="ui-panel-titlebar-icon ui-corner-all ui-state-default"
						title="Imprimir">
						<h:outputText styleClass="ui-icon ui-icon-print" />
						<p:printer target="Rel" />
					</h:commandLink>

					<h:commandLink
						styleClass="ui-panel-titlebar-icon ui-corner-all ui-state-default"
						style="width:16px;heigh:16px;">
						<p:graphicImage style=" margin-top:1px;margin-left:2px"
							title="Exportar relatório para excel" url="/imagens/ui-xls.png"></p:graphicImage>
						<p:dataExporter type="xls" target="Rel"
							fileName="Listagem de Veículos Estacionados" />
					</h:commandLink>
				</f:facet>

				<p:dataTable id="Rel" value="#{RelatMovVeicBean.vehicleParked}"
					var="rel" rowIndexVar="rowIndex"
					emptyMessage="Nenhum registro encontrado"
					style="position: auto;margin-top:40px" paginator="true" rows="20"
					rowsPerPageTemplate="10,20,30,40,50">

					<p:column style="width: 97px">
						<f:facet name="header">Data</f:facet>
						<h:outputText value="#{rel.getDataOccurence()}">
							<f:convertDateTime locale="pt_BR" pattern="dd/MM/yyyy" />
						</h:outputText>
					</p:column>
					<p:column style="width: 97px">
						<f:facet name="header">Hora</f:facet>
						<h:outputText value="#{rel.getDataOccurence()}">
							<f:convertDateTime pattern="HH:mm:ss" timeZone="#{RelatMovVeicBean.timeZone}" />
						</h:outputText>
					</p:column>
					<p:column style="width: 97px;" sortBy="#{rel.getVehiclePlate()}">
						<f:facet name="header">Placa</f:facet>
						<h:outputText value="#{rel.getVehiclePlate()}" />
					</p:column>
					<p:column style="width: 97px;" sortBy="#{rel.getVehiclePrism()}">
						<f:facet name="header">Prisma</f:facet>
						<h:outputText value="#{rel.getVehiclePrism()}" />
					</p:column>
					<p:column style="width: 97px;" sortBy="#{rel.getIdTicket()}">
						<f:facet name="header">Ticket</f:facet>
						<h:outputText value="#{rel.getIdTicket()}">
							<f:convertNumber pattern="000000" />
						</h:outputText>
					</p:column>
					<p:column style="width: 97px;" sortBy="#{rel.getVehicleBrand()}">
						<f:facet name="header">Marca</f:facet>
						<h:outputText value="#{rel.getVehicleBrand()}" />
					</p:column>
					<p:column style="width: 97px;" sortBy="#{rel.getVehicleType()}">
						<f:facet name="header">Tipo</f:facet>
						<h:outputText value="#{rel.getVehicleType()}" />
					</p:column>
					<p:column style="width: 97px;" sortBy="#{rel.getVehicleModel()}">
						<f:facet name="header">Modelo</f:facet>
						<h:outputText value="#{rel.getVehicleModel()}" />
					</p:column>
					<p:column style="width: 97px;" sortBy="#{rel.getVehicleColor()}">
						<f:facet name="header">Cor</f:facet>
						<h:outputText value="#{rel.getVehicleColor()}" />
					</p:column>

				</p:dataTable>
				<br />
				<p:separator />
				<br />
				<p:commandButton id="searchButton" value="Atualizar"
					image="ui-icon-search" update="@form" ajax="false"
					title="Atualizar" actionListener="#{RelatMovVeicBean.refresh()}" />

			</p:panel>
		</h:form>
	</ui:define>
</ui:decorate>

</html>
